import Vue from 'vue'
import App from './App.vue'
import $ from 'jquery'
import router from './router'
import store from './store'
import axios from 'axios'
import 'lib-flexible'
import Navigation from 'vue-navigation'
import VueLazyload from 'vue-lazyload'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import APPKEY from './assets/js/app/appKeywords'
import cookies from './assets/js/app/cookies'
// import Toast from './assets/js/common/toast'
import md5 from 'js-md5'
import layer from 'vue2-layer-mobile'
import VueBus from './assets/js/app/vue-bus'
import 'swiper/dist/css/swiper.css'
import './assets/css/reset.css'
import './assets/css/animate.css'
import './registerServiceWorker'
// Vue.use(Toast)
Vue.use(layer)
Vue.use(VueAwesomeSwiper)
Vue.use(VueLazyload)

Vue.use(Navigation, { router, store })
Vue.config.productionTip = false
Vue.prototype.$axios = axios
Vue.prototype.$md5 = md5
Vue.prototype.$APPKEY = APPKEY
Vue.prototype.$cookies = cookies
Vue.prototype.$bus = VueBus

new Vue({
  router,
  store,
  $,
  md5,
  VueBus,
  cookies,
  axios,
  APPKEY,
  render: h => h(App),
  methods: {
    addIconLink(link) {
      let s = document.createElement('script')
      s.type = 'text/javascript'
      s.src = link
      document.body.appendChild(s)
    }
  },
  mounted() {
    this.addIconLink('https://at.alicdn.com/t/font_851008_jc1cr6ya7z.js')
    this.addIconLink('https://at.alicdn.com/t/font_738716_w2jxfkwd8v.js')
  }
}).$mount('#app')
